<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Star Rating</title>
    <style>
        .rating{
            display: flex;
            flex-direction: row-reverse;
            align-items: center;
            justify-content: center;
        }
        .rating-star{
            color: #ddd;
            font-size: 42px;
            margin: 0 21px;
            position: relative;
        }
        .rating-star::before{
            content: "\2605";
            position: absolute;
            left: 0;
        }
        .rating-star:hover::before,
        .rating-star:hover ~ .rating-star::before{
            color: gold;
        }
    </style>
</head>
<body>
    <div class="rating">
        <div class="rating-star"></div>
        <div class="rating-star"></div>
        <div class="rating-star"></div>
        <div class="rating-star"></div>
        <div class="rating-star"></div>
    </div>
</body>
</html>